package examtest;

import java.io.IOException;
import java.io.Reader;
import java.util.Scanner;

public class homework49 {
    public static void main(String[] args) throws IOException {
        Scanner input = new Scanner(System.in);

        System.out.println("请输入语句");
        String str = input.next();
        Integer tem=0;
        byte[] strs=str.getBytes();
        for (int i = 0; i < strs.length; i++) {
            if (strs[i]=='('){
                tem++;
            }
            if (strs[i]==')'){
                tem--;
            }
            if (tem<0){
                System.out.println("错误！左括号应该先开始");
                break;
            }
        }

        if (tem==0){
            System.out.println("一切正常！");
        }
        if (tem>0){
            System.out.println("左括号多了");
        }
        if (tem<0){
            System.out.println("右括号多了，或者右括号不正确的开始了！");
        }
        return;
    }
}
